import request from "../request";
import {
    MemberDetailParams,
    MembersDataParams, ModifyUserRoleParams,ModifyUserSTATEParams,
    ModifyUserStatusParams,
    StudentDataParams,
    TeacherDataParams
} from "../../types/requestTypes";
import {
    FetchMemberDetailRes,
    FetchMembersDataRes,
    ModifyUserRoleRes,
    ModifyUserStatusRes,
    ResponseRET
} from "../../types/responseTypes";

/**
 * 获取个人资料
 * @param userId
 */
export const getUserData = (userId: number | string): Promise<ResponseRET> => request.post('/restapi/STUA_mbreport_new/RDGRZL',{
    OPERATOR_ID: userId
},true)

/**
 * 修改学生信息
 * @param params
 */
export const modifyStudentData = (params: StudentDataParams): Promise<ResponseRET> => request.post('/restapi/STUA_mbreport_new/UP_STUDENTS',params,true)

/**
 * 修改学生资料多种证件
 * @param params
 */
export const modifyStudentZZData = (params: StudentDataParams): Promise<ResponseRET> => request.post('/restapi/STUA_mbreport_new/UP_STUDENTS_ZZ',params,true)


/**
 * 修改教师信息
 * @param params
 */
export const modifyTeacherData = (params: TeacherDataParams): Promise<ResponseRET> => request.post('/restapi/STUA_mbreport_new/UP_TEACHERS', params,true)

/**
 * 查询人员资料列表
 * @param params
 */
export const getMembersData = (params: MembersDataParams): Promise<FetchMembersDataRes> => request.post('/restapi/STUA_mbreport_new/RDCUSERS_LIST',params,true)

/**
 * 查询人员资料详情
 * @param params
 */
export const getMemberDetail = (params: MemberDetailParams): Promise<FetchMemberDetailRes> => request.post('/restapi/STUA_mbreport_new/RDCUSERS_ID', params,true)

/**
 * 修改用户状态
 * @param params
 */
export const modifyUserStatus = (params: ModifyUserStatusParams): Promise<ModifyUserStatusRes> => request.post('/restapi/STUA_mbreport_new/UP_CUSERS_STATE', params, true)

/**
 * 修改用户角色
 * @param params
 */
export const modifyUserRole = (params: ModifyUserRoleParams): Promise<ModifyUserRoleRes> => request.post('/restapi/STUA_mbreport_new/UP_CUSERS_ROLE', params,true)
